home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / Interfaces&Libraries / Universal / Interfaces / CIncludes / EPPC.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-17  |  4.3 KB  |  171 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        EPPC.h
  3.  
  4.      Contains:    High Level Event Manager Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1988-1998 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __EPPC__
  18. #define __EPPC__
  19.  
  20. #ifndef __ERRORS__
  21. #include <Errors.h>
  22. #endif
  23. #ifndef __APPLETALK__
  24. #include <AppleTalk.h>
  25. #endif
  26. #ifndef __FILES__
  27. #include <Files.h>
  28. #endif
  29. #ifndef __PPCTOOLBOX__
  30. #include <PPCToolbox.h>
  31. #endif
  32. #ifndef __PROCESSES__
  33. #include <Processes.h>
  34. #endif
  35. #ifndef __EVENTS__
  36. #include <Events.h>
  37. #endif
  38.  
  39.  
  40.  
  41. #if PRAGMA_ONCE
  42. #pragma once
  43. #endif
  44.  
  45. #ifdef __cplusplus
  46. extern "C" {
  47. #endif
  48.  
  49. #if PRAGMA_IMPORT
  50. #pragma import on
  51. #endif
  52.  
  53. #if PRAGMA_STRUCT_ALIGN
  54.     #pragma options align=mac68k
  55. #elif PRAGMA_STRUCT_PACKPUSH
  56.     #pragma pack(push, 2)
  57. #elif PRAGMA_STRUCT_PACK
  58.     #pragma pack(2)
  59. #endif
  60.  
  61.  
  62. enum {
  63.                                                                 /* postOptions currently supported */
  64.     receiverIDMask                = 0x0000F000,
  65.     receiverIDisPSN                = 0x00008000,
  66.     receiverIDisSignature        = 0x00007000,
  67.     receiverIDisSessionID        = 0x00006000,
  68.     receiverIDisTargetID        = 0x00005000,
  69.     systemOptionsMask            = 0x00000F00,
  70.     nReturnReceipt                = 0x00000200,
  71.     priorityMask                = 0x000000FF,
  72.     nAttnMsg                    = 0x00000001
  73. };
  74.  
  75.  
  76. enum {
  77.                                                                 /* constant for return receipts */
  78.     HighLevelEventMsgClass        = FOUR_CHAR_CODE('jaym'),
  79.     rtrnReceiptMsgID            = FOUR_CHAR_CODE('rtrn')
  80. };
  81.  
  82.  
  83. enum {
  84.     msgWasPartiallyAccepted        = 2,
  85.     msgWasFullyAccepted            = 1,
  86.     msgWasNotAccepted            = 0
  87. };
  88.  
  89.  
  90. struct TargetID {
  91.     long                             sessionID;
  92.     PPCPortRec                         name;
  93.     LocationNameRec                 location;
  94.     PPCPortRec                         recvrName;
  95. };
  96. typedef struct TargetID                    TargetID;
  97. typedef TargetID *                        TargetIDPtr;
  98. typedef TargetIDPtr *                    TargetIDHandle;
  99. typedef TargetIDHandle                     TargetIDHdl;
  100.  
  101. typedef TargetID                         SenderID;
  102. typedef SenderID *                        SenderIDPtr;
  103.  
  104. struct HighLevelEventMsg {
  105.     unsigned short                     HighLevelEventMsgHeaderLength;
  106.     unsigned short                     version;
  107.     unsigned long                     reserved1;
  108.     EventRecord                     theMsgEvent;
  109.     unsigned long                     userRefcon;
  110.     unsigned long                     postingOptions;
  111.     unsigned long                     msgLength;
  112. };
  113. typedef struct HighLevelEventMsg        HighLevelEventMsg;
  114. typedef HighLevelEventMsg *                HighLevelEventMsgPtr;
  115. typedef HighLevelEventMsgPtr *            HighLevelEventMsgHandle;
  116. typedef HighLevelEventMsgHandle         HighLevelEventMsgHdl;
  117. typedef CALLBACK_API( Boolean , GetSpecificFilterProcPtr )(void *contextPtr, HighLevelEventMsgPtr msgBuff, const TargetID *sender);
  118. typedef STACK_UPP_TYPE(GetSpecificFilterProcPtr)                 GetSpecificFilterUPP;
  119. enum { uppGetSpecificFilterProcInfo = 0x00000FD0 };             /* pascal 1_byte Func(4_bytes, 4_bytes, 4_bytes) */
  120. #define NewGetSpecificFilterProc(userRoutine)                     (GetSpecificFilterUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppGetSpecificFilterProcInfo, GetCurrentArchitecture())
  121. #define CallGetSpecificFilterProc(userRoutine, contextPtr, msgBuff, sender)  CALL_THREE_PARAMETER_UPP((userRoutine), uppGetSpecificFilterProcInfo, (contextPtr), (msgBuff), (sender))
  122. EXTERN_API( OSErr )
  123. PostHighLevelEvent                (const EventRecord *    theEvent,
  124.                                  void *                    receiverID,
  125.                                  unsigned long             msgRefcon,
  126.                                  void *                    msgBuff,
  127.                                  unsigned long             msgLen,
  128.                                  unsigned long             postingOptions)                        THREEWORDINLINE(0x3F3C, 0x0034, 0xA88F);
  129.  
  130. EXTERN_API( OSErr )
  131. AcceptHighLevelEvent            (TargetID *                sender,
  132.                                  unsigned long *        msgRefcon,
  133.                                  void *                    msgBuff,
  134.                                  unsigned long *        msgLen)                                THREEWORDINLINE(0x3F3C, 0x0033, 0xA88F);
  135.  
  136. EXTERN_API( OSErr )
  137. GetProcessSerialNumberFromPortName (const PPCPortRec *    portName,
  138.                                  ProcessSerialNumber *    pPSN)                                THREEWORDINLINE(0x3F3C, 0x0035, 0xA88F);
  139.  
  140. EXTERN_API( OSErr )
  141. GetPortNameFromProcessSerialNumber (PPCPortRec *        portName,
  142.                                  const ProcessSerialNumber * pPSN)                            THREEWORDINLINE(0x3F3C, 0x0046, 0xA88F);
  143.  
  144. EXTERN_API( Boolean )
  145. GetSpecificHighLevelEvent        (GetSpecificFilterUPP     aFilter,
  146.                                  void *                    contextPtr,
  147.                                  OSErr *                err)                                THREEWORDINLINE(0x3F3C, 0x0045, 0xA88F);
  148.  
  149.  
  150.  
  151. #if PRAGMA_STRUCT_ALIGN
  152.     #pragma options align=reset
  153. #elif PRAGMA_STRUCT_PACKPUSH
  154.     #pragma pack(pop)
  155. #elif PRAGMA_STRUCT_PACK
  156.     #pragma pack()
  157. #endif
  158.  
  159. #ifdef PRAGMA_IMPORT_OFF
  160. #pragma import off
  161. #elif PRAGMA_IMPORT
  162. #pragma import reset
  163. #endif
  164.  
  165. #ifdef __cplusplus
  166. }
  167. #endif
  168.  
  169. #endif /* __EPPC__ */
  170.  
  171.